package com.fr.data;

import com.fr.base.core.ComparatorUtils;
import com.fr.base.xml.XMLPrintWriter;
import com.fr.base.xml.XMLableReader;
import com.fr.data.condition.Condition;
import com.fr.data.core.DataXMLUtils;

public abstract class AbstractDict
  implements Dictionary
{
  protected Condition condition;

  public Condition getCondition()
  {
    return this.condition;
  }

  public void setCondition(Condition paramCondition)
  {
    this.condition = paramCondition;
  }

  public void readXML(XMLableReader paramXMLableReader)
  {
    if ((paramXMLableReader.isChildNode()) && ("Condition".equals(paramXMLableReader.getTagName())))
      this.condition = DataXMLUtils.readCondition(paramXMLableReader);
  }

  public void writeXML(XMLPrintWriter paramXMLPrintWriter)
  {
    if (this.condition != null)
      DataXMLUtils.writeXMLCondition(paramXMLPrintWriter, this.condition);
  }

  public String[] getDependence()
  {
    if (this.condition != null)
      return this.condition.getDependence();
    return new String[0];
  }

  public void reset()
  {
  }

  public String toString()
  {
    return super.getClass().getName();
  }

  public boolean equals(Object paramObject)
  {
    return ((paramObject instanceof AbstractDict) && (ComparatorUtils.equals(((AbstractDict)paramObject).condition, this.condition)));
  }

  public Object clone()
    throws CloneNotSupportedException
  {
    return super.clone();
  }
}